package com.wit.witmg.api;


import com.wit.witmg.service.ITJldzpcomService;
import com.wit.witmg.service.ITTjdzpcomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bob
 * @since 2025-03-26
 */
@RestController
@RequestMapping("tjdzpcom")
@Api(tags = "电阻片通用工序统计API")
public class TTjdzpcomController {
    @Resource
    private ITTjdzpcomService service;

    @ApiOperation("添加")
    @PostMapping("add")
    public Object add(HttpServletRequest request,
                      @RequestParam("json") String json) {
        return service.add(request,json);
    }

    @ApiOperation("获取")
    @PostMapping("get")
    public Object get(HttpServletRequest request,
                      @RequestParam(value = "gx",required = false,defaultValue = "0") Integer gx,//1要重新去记录表更新统计
                      @RequestParam("tmd") Integer tmd,
                      @RequestParam(value = "ph",required = false) String ph,
                      @RequestParam(value = "dt0",required = false) String dt0,
                      @RequestParam(value = "dt1",required = false) String dt1)
    {
        return service.get(request,tmd,ph,gx,dt0,dt1);
    }

    @ApiOperation("获取进度")
    @PostMapping("getjd")
    public Object getjd(HttpServletRequest request,
                        @RequestParam("ph") String ph)
    {
        return service.getjd(request,ph);
    }
}
